<extend name="Public:base" />
<!-- 网站标题 -->
<block name="title">分组管理页面</block>
<block name="appendheader"> 
	<!-- 删除确认插件 --> 
	<script type="text/javascript" src="__PUBLIC__/artDialog/jquery.artDialog.js?skin=default"></script> 
	<script type="text/javascript" src="__PUBLIC__/artDialog/iframeTools.js"></script> 
	<script type="text/javascript" src="__PUBLIC__/common/js/list.js"></script> 
	<script type="text/javascript">
		$(function() {
			$("#WebMenu-2000").addClass('active');	//选中父菜单
			$("#WebMenu-2020").addClass('active');	//选中当前菜单
		});
		
		//重置密码
		function resetpwd(id) {
			$('#admin_role').modal({
		    	remote:'__APP__?g=Admin&m=GroupsUser&a=resetpwd&id='+id
		    });
		}
		
		//下载详细数据
		function download() {
			var type = $("#type").val();
			var area_code = $("#area_code").val();
			var school = $("#school").val();
			var objid = '';
			if(type == '') {
				art.dialog.alert("没有选择用户类型！");
				return;
			}
			if(type == 'd') {
				if(area_code == '') {
					art.dialog.alert("没有选择县区！");
					return;
				} else {
					objid = area_code;
				}
			} else {
				if(school == '') {
					art.dialog.alert("没有选择学校！");
					return;
				} else {
					objid = school;
				}
			}
			window.open('__APP__?g=Admin&m=GroupsUser&a=download_bat&type=' + type + '&objid=' + objid, '问卷数据下载', '');
		}
		
		//改变检索条件时提交表单
		function submit_form() {
			$("#searchForm").submit();
		}
	</script> 
	<script type="text/javascript">
		$(function() {
			//特别注意：
			//在模态窗口中异步加载的内容只有第一次传递参数值是合适的，在不刷新页面的情况下以后的加载都直接从缓存中读取
			//为避免此类bug，在每次关闭模态窗口时在回调函数中刷新整个网页（songyb 2015-08-18）
			$('#set_user_role').on('hidden.bs.modal', function (e) {
				location.reload(true);
			});	
		});
	</script> 
</block>
</block>
<!-- 当前位置 -->
<block name="breadcrumb">
	<div class="page-header pull-left">
		<div class="page-title">成员管理</div>
	</div>
	<ol class="breadcrumb page-breadcrumb pull-left">
		<li><i class="fa fa-home"></i>&nbsp;<a href="__APP__?g=Admin">首页</a>&nbsp;&nbsp;<i class="fa fa-angle-right"></i>&nbsp;&nbsp;</li>
		<li><a href="#">基础数据</a>&nbsp;&nbsp;<i class="fa fa-angle-right"></i>&nbsp;&nbsp;</li>
		<li><a href="#">分组管理</a>&nbsp;&nbsp;<i class="fa fa-angle-right"></i>&nbsp;&nbsp;</li>
		<li class="active">成员管理</li>
	</ol>
</block>
<!-- 网页主内容区 -->
<block name="main_content">
	<div class="row">
		<div class="col-md-12">
			<div class="portlet box">
				<div class="portlet-body">
					<div class="row mbm">
						<div class="col-md-3">
							<a href="__APP__?g={:GROUP_NAME}&m={:MODULE_NAME}&a=add&groupsid={$groupsid}" class="btn btn-success"><i class="fa fa-plus"></i>&nbsp;添加</a>&nbsp;
							<a href="__APP__?g={:GROUP_NAME}&m={:MODULE_NAME}&a=import&groupsid={$groupsid}" class="btn btn-success"><i class="fa fa-plus"></i>&nbsp;批量导入</a>&nbsp;
							<a href="javascript:confirm_deleteall();" class="btn btn-danger"><i class="fa fa-trash-o"></i>&nbsp;批量删除</a>&nbsp;
						</div>
						<div class="col-md-9">
							<form id="searchForm" name="searchForm" action="__APP__?g={:GROUP_NAME}&m={:MODULE_NAME}&a={:ACTION_NAME}" method="post">
								<div class="col-sm-9 col-md-9">
									<div class="row">
										<div class="col-sm-2">
											<select id="province_code" name="province_code" class="form-control" style="width:100%;" onChange="submit_form()">
												<option value="">-全部省份-</option>
												<volist name="province_list" id="vo">
													<option value="{$vo.code}" <eq name="Think.request.province_code" value="$vo.code">selected</eq> >{$vo.name}</option>
												</volist>
											</select>
										</div>
										<div class="col-sm-2">
											<select id="city_code" name="city_code" class="form-control" onChange="submit_form()">
												<option value="">-全部市州-</option>
												<volist name="city_list" id="vo">
													<option value="{$vo.code}" <eq name="Think.request.city_code" value="$vo.code">selected</eq> >{$vo.name}</option>
												</volist>
											</select>
										</div>
										<div class="col-sm-2">
											<select id="area_code" name="area_code" class="form-control" onChange="submit_form()">
												<option value="">-全部县区-</option>
												<volist name="area_list" id="vo">
													<option value="{$vo.code}" <eq name="Think.request.area_code" value="$vo.code">selected</eq> >{$vo.name}</option>
												</volist>
											</select>
										</div>
										<div class="col-sm-2">
											<select id="school" name="school" class="form-control" onChange="submit_form()">
												<option value="">-全部学校-</option>
												<volist name="school_list" id="vo">
													<option value="{$vo.id}" <eq name="Think.request.school" value="$vo.id">selected</eq> >{$vo.name}</option>
												</volist>
											</select>
										</div>
										<div class="col-sm-2">
											<select id="type" name="type" class="form-control" onChange="submit_form()">
												<option value="">-全部用户-</option>
												<volist name="type_list" id="vo">
													<option value="{$vo.id}" <eq name="Think.request.type" value="$vo.id">selected</eq> >{$vo.name}</option>
												</volist>
											</select>
										</div>
										<div class="col-sm-2">
											<a type="button" href="javascript:download()" class="btn btn-green mbs"><i class="fa fa-download"></i>&nbsp;下载问卷数据</a>
<!--											<div class="btn-group">-->
<!--												<button type="button" data-toggle="dropdown" class="btn btn-green dropdown-toggle mbs"><i class="fa fa-download"></i>下载问卷数据 &nbsp;-->
<!--													<span class="caret"></span>-->
<!--												</button>-->
<!--												<ul role="menu" class="dropdown-menu">-->
<!--													<li><a type="button" href="javascript:download('a')"><i class="fa fa-download"></i>&nbsp;学生问卷详细数据</a></li>-->
<!--													<li><a type="button" href="javascript:download('b')"><i class="fa fa-download"></i>&nbsp;教师问卷详细数据</a></li>-->
<!--													<li><a type="button" href="javascript:download('c')"><i class="fa fa-download"></i>&nbsp;校管问卷详细数据</a></li>-->
<!--													<li><a type="button" href="javascript:download('d')"><i class="fa fa-download"></i>&nbsp;县管问卷详细数据</a></li>-->
<!--												</ul>-->
<!--				                           	</div>-->
										</div>
									</div>
								</div>
								<div class="col-md-3"> 
									<div class="dataTables_filter" id="table_id_filter">
										<label>
											<div class="input-group">
												<input type="hidden" name="groupsid" value="{$Think.request.groupsid}"/>
												<input type="search" value="{$Think.request.search_keyword}" name="search_keyword" placeholder="请输入关键字检索" class="form-control" />
												<span class="input-group-btn">
													<input type="submit" class="btn btn-success" value="查询" />
												</span>
											</div>
										</label>
									</div>
								</div>
							</form>
						</div>
					</div>
					<form id="myform" name="myform" action="__APP__?g=Admin&m=GroupsUser&a=delete&groupsid={$groupsid}" method="post" >
						<table class="table table-hover table-striped table-bordered table-advanced tablesorter tb-sticky-header">
							<thead>
								<tr>
									<th width="10"><input type="checkbox" class="checkall" /></th>
									<th width="50">用户名</th>
									<th width="80">姓名</th>
									<th width="50">性别</th>
									<th width="100">用户类型</th>
									<th width="200">所属地域</th>
									<th width="100">所在学校</th>
									<th width="100">学校类型</th>
									<th width="100">提交题目数量</th>
									<th width="100">提交信息数量</th>
									<th width="80">开始时间</th>
									<th width="80">结束时间</th>
									<th width="80">所用时间</th>
									<th>问卷反馈</th>
								    <th width="130">操作</th>
								</tr>
							</thead>
							<tbody>
								<volist name="data" id="vo">
									<tr>
										<td><input type="checkbox" id="ids" name="ids[{$i}]" value="{$vo.id}" /></td>
										<td>{$vo.name}</td>
										<td>{$vo.real_name}</td>
										<td>{$vo.gender}</td>
										<td>{$vo.type}</td>
										<td>{$vo.area_code}&nbsp;{$vo.area_name}</td>
										<td>{$vo.school}</td>
										<td>{$vo.school_type}</td>
										<td>{$vo.item_num}</td>
										<td>{$vo.value_num}</td>
										<td>{$vo.begin_time}</td>
										<td>{$vo.end_time}</td>
										<td>{$vo.used_time}</td>
										<td>{$vo.feedback}</td>
										<td>
	                                        <div class="btn-group">
												<button type="button" data-toggle="dropdown" class="btn btn-green dropdown-toggle btn-xs mbs">操作 &nbsp;
	                                                <span class="caret"></span>
	                                            </button>
                                                <ul role="menu" class="dropdown-menu">
	                                                <li><a type="button" href="javascript:resetpwd('{$vo.id}');"><i class="fa fa-edit"></i>&nbsp;重置密码</a></li>
	                                                <li><a type="button" href="javascript:art_confirm('您确定要清楚该用户的提交问卷数据吗？清除后将不可恢复！','__APP__?g={:GROUP_NAME}&m={:MODULE_NAME}&a=clear_item_value&id={$vo.id}&groupsid={$groupsid}');"><i class="fa fa-magic"></i>&nbsp;清除问卷数据</a></li>
<!--	                                                <li class="divider"></li>-->
	                                            </ul>
	                                       	</div>
<!--											<a type="button" href="__APP__?g={:GROUP_NAME}&m={:MODULE_NAME}&a=edit&id={$vo.id}&groupsid={$groupsid}" class="btn btn-blue btn-xs mbs"><i class="fa fa-edit"></i>&nbsp;编辑</a>&nbsp;-->
											<a type="button" href="javascript:confirm_delete('ids[{$i}]')" class="btn btn-danger btn-xs mbs"><i class="fa fa-trash-o"></i>&nbsp;删除</a> 
										</td>
									</tr>
								</volist>
							</tbody>
						</table>
					</form>
					<!-- 显示分页信息 --> 
					{$show}
				</div>
			</div>
		</div>
	</div>
	<!-- 重置密码 -->
    <div style="display: display;" id="admin_role" tabindex="-1" role="dialog" aria-labelledby="modal-responsive-label" aria-hidden="true" class="modal fade">
		<div class="modal-dialog">
			<div class="modal-content"></div>
		</div>
	</div>
</block>
